<template>
<div class="content">

<el-card class="card" v-for="(item,index) in huodongdata" :key="index" :body-style="{border: '7px solid black', padding: '10px', backgroundColor: 'lightblue'}">
  <div class="margin">
    健身器材:{{item.jianshenqicai}}
  </div>
  <div class="margin">
    健身时长:{{item.jianshenshizhang}}
  </div>
  <div class="margin">
    健身项目:{{item.jianshenxiangmu}}
  </div>
  <div class="margin">
    活动开始时间:{{item.shijian}}
  </div>
</el-card>

</div>
</template>
<script>
import router from '@/router/router-static'
export default {
  data() {
    return {
      huodongdata:[]

    }},
  mounted(){
    this.init();
  },
  methods:{
    init(){
        if(this.$storage.get('Token')){
        this.$http({
            url: `${this.$storage.get('sessionTable')}/session`,
            method: "get"
        }).then(({ data }) => {
            if (data && data.code != 0) {
            router.push({ name: 'login' })
            }
        });
          this.$http({
            url: `/jianshenhuodong/getActivitDetail`,
            method: "get"
          }).then((res) => {
            this.huodongdata=res.data.data
          });
        }else{
            router.push({ name: 'login' })
        }
    }
  }
};
</script>

<style lang="scss" scoped>
.content {
  display: flex;
  //align-items: center;
 justify-content: flex-start;
  flex-wrap: wrap;
  width: 100%;
  height: 100%;
  min-height: 500px;
  text-align: center;
  .main-text{
    font-size: 38px;
    font-weight: bold;
    margin-top: 15%;
  }
  .text {
    font-size: 24px;
    font-weight: bold;
    color: #333;
  }
  .card{
    width: 250px;
    height: 200px;
    text-align: left;
    margin: 20px;
  }
  .margin{
    margin: 10px;
}
}
</style>
